/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package picounit.verify.constraint;

import picounit.Ignore;
import picounit.IgnoreReason;
import picounit.Should;
import picounit.features.verify.Constraints;
import picounit.features.verify.DefaultStringConstraints;
import picounit.features.verify.Evaluator;
import picounit.verify.BooleanArrayConstraints;
import picounit.verify.BooleanConstraints;
import picounit.verify.ByteArrayConstraints;
import picounit.verify.ByteConstraints;
import picounit.verify.CharacterArrayConstraints;
import picounit.verify.CharacterConstraints;
import picounit.verify.CollectionConstraints;
import picounit.verify.DoubleArrayConstraints;
import picounit.verify.DoubleConstraints;
import picounit.verify.FileConstraints;
import picounit.verify.FloatArrayConstraints;
import picounit.verify.FloatConstraints;
import picounit.verify.IntegerArrayConstraints;
import picounit.verify.IntegerConstraints;
import picounit.verify.ListConstraints;
import picounit.verify.LongArrayConstraints;
import picounit.verify.LongConstraints;
import picounit.verify.SetConstraints;
import picounit.verify.ShortArrayConstraints;
import picounit.verify.ShortConstraints;
import picounit.verify.StringArrayConstraints;
import picounit.verify.TypedArrayConstraints;
import picounit.verify.TypedConstraints;

public class StringConstraintsTest extends ConstraintsTest implements Ignore {
	private DefaultStringConstraints stringConstraints;

	private BooleanConstraints booleanConstraints;
	private ByteConstraints byteConstraints;
	private CharacterConstraints charConstraints;
	private DoubleConstraints doubleConstraints;
	private FloatConstraints floatConstraints;
	private IntegerConstraints intConstraints;
	private LongConstraints longConstraints;
	private ShortConstraints shortConstraints;
	private FileConstraints fileConstraints;
	private TypedConstraints typedConstraints;

	private BooleanArrayConstraints booleanArrayConstraints;

	private ByteArrayConstraints byteArrayConstraints;

	private CharacterArrayConstraints characterArrayConstraints;

	private DoubleArrayConstraints doubleArrayConstraints;

	private FloatArrayConstraints floatArrayConstraints;

	private IntegerArrayConstraints integerArrayConstraints;

	private LongArrayConstraints longArrayConstraints;

	private ShortArrayConstraints shortArrayConstraints;

	private StringArrayConstraints stringArrayConstraints;

	private TypedArrayConstraints typedArrayConstraints;

	private CollectionConstraints collectionConstraints;

	private ListConstraints listConstraints;

	private SetConstraints setConstraints;

	public void mock(BooleanConstraints booleanConstraints,
		ByteConstraints byteConstraints, CharacterConstraints charConstraints,
		DoubleConstraints doubleConstraints, FloatConstraints floatConstraints,
		IntegerConstraints intConstraints, LongConstraints longConstraints,
		ShortConstraints shortConstraints, FileConstraints fileConstraints,
		TypedConstraints typedConstraints, BooleanArrayConstraints booleanArrayConstraints,
		ByteArrayConstraints byteArrayConstraints,
		CharacterArrayConstraints characterArrayConstraints,
		DoubleArrayConstraints doubleArrayConstraints, FloatArrayConstraints floatArrayConstraints,
		IntegerArrayConstraints integerArrayConstraints, LongArrayConstraints longArrayConstraints,
		ShortArrayConstraints shortArrayConstraints, StringArrayConstraints stringArrayConstraints,
		TypedArrayConstraints typedArrayConstraints, CollectionConstraints collectionConstraints,
		ListConstraints listConstraints, SetConstraints setConstraints) {

		this.booleanConstraints = booleanConstraints;
		this.byteConstraints = byteConstraints;
		this.charConstraints = charConstraints;
		this.doubleConstraints = doubleConstraints;
		this.floatConstraints = floatConstraints;
		this.intConstraints = intConstraints;
		this.longConstraints = longConstraints;
		this.shortConstraints = shortConstraints;
		this.fileConstraints = fileConstraints;
		this.typedConstraints = typedConstraints;
		this.booleanArrayConstraints = booleanArrayConstraints;
		this.byteArrayConstraints = byteArrayConstraints;
		this.characterArrayConstraints = characterArrayConstraints;
		this.doubleArrayConstraints = doubleArrayConstraints;
		this.floatArrayConstraints = floatArrayConstraints;
		this.integerArrayConstraints = integerArrayConstraints;
		this.longArrayConstraints = longArrayConstraints;
		this.shortArrayConstraints = shortArrayConstraints;
		this.stringArrayConstraints = stringArrayConstraints;
		this.typedArrayConstraints = typedArrayConstraints;
		this.collectionConstraints = collectionConstraints;
		this.listConstraints = listConstraints;
		this.setConstraints = setConstraints;
	
		this.stringConstraints = new DefaultStringConstraints(evaluator(), booleanConstraints,
			byteConstraints, charConstraints, doubleConstraints, floatConstraints,
			intConstraints, longConstraints, shortConstraints, fileConstraints,
			typedConstraints, booleanArrayConstraints, byteArrayConstraints,
			characterArrayConstraints, doubleArrayConstraints, floatArrayConstraints,
			integerArrayConstraints, longArrayConstraints, shortArrayConstraints,
			stringArrayConstraints, typedArrayConstraints, collectionConstraints,
			listConstraints, setConstraints);
	}

	@Override
	protected Constraints constraints(Evaluator evaluator) {
		return new DefaultStringConstraints(evaluator, booleanConstraints,
			byteConstraints, charConstraints, doubleConstraints, floatConstraints,
			intConstraints, longConstraints, shortConstraints, fileConstraints,
			typedConstraints, booleanArrayConstraints, byteArrayConstraints,
			characterArrayConstraints, doubleArrayConstraints, floatArrayConstraints,
			integerArrayConstraints, longArrayConstraints, shortArrayConstraints,
			stringArrayConstraints, typedArrayConstraints, collectionConstraints,
			listConstraints, setConstraints);
	}

	public void testIsEqualTo(Should should) {
//		evaluate(new StringIsEqual("abc", false));
		
		should.expectAboveWhenTheFollowingOccurs();
		
		stringConstraints.isEqualTo("abc");
	}
	
	public void testIsEqualToIgnoringCase(Should should) {
//		evaluate(new StringIsEqual("abc", true));
		
		should.expectAboveWhenTheFollowingOccurs();
		
		stringConstraints.ignoringCase().isEqualTo("abc");
	}

	public void ignoredWhen(IgnoreReason ignoreReason) {
		ignoreReason.setWhy("Have done yet!");
	}
}
